docs: Explain the symbolic icon paintable situation
authorMatthias Clasen <mclasen@redhat.com>
Thu, 15 Oct 2020 14:08:03 +0000 (10:08 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 15 Oct 2020 15:42:50 +0000 (11:42 -0400)
Add a paragraph to the migration guide that explains
how to properly render symbolic GtkIconPaintables.

Also mention this in the GtkIconPaintable docs.

There's a reason you can't spell 'paintable' without
'pain'...

docs/reference/gtk/migrating-3to4.md
gtk/gtkicontheme.c

index 278ec2221d5c9209390becc26b872b47f2e38bf5..6ce96a88789554ea1b4083fdb00af6a2853dd4eb 100644 (file)
@@ -1037,6 +1037,14 @@ of a #GtkIconInfo. It always returns a paintable in the requested size, and
 never fails. A number of no-longer-relevant lookup flags and API variants
 have been removed.
 
+Note that while GTK 4 is moving towards #GdkPaintable as a primary API
+for paintable content, it is meant to be a 'pure' content producer, therefore
+a #GtkIconPaintable for a symbolic icon will *not* get recolored depending
+on the context it is rendered it. To properly render a symbolic icon that
+is provided in the form of a #GtkIconPaintable (this can be checked with
+gtk_icon_paintable_is_symbolic()), you have to call
+gtk_icon_paintable_get_icon_name() and set the icon name on a #GtkImage.
+
 ### Update to GtkFileChooser API changes
 
 GtkFileChooser moved to a GFile-based API. If you need to convert a
index cc0cfaa2c539f01a5684da8fd11b9eec9e96e306..879213584653ee735006c2223cb29ab1039eead7 100644 (file)
@@ -3670,6 +3670,9 @@ gtk_icon_paintable_get_icon_name (GtkIconPaintable *icon)
  * the file name and not the file contents for determining this.
  * This behaviour may change in the future.
  *
+ * Note that to render a symbolic #GtkIconPaintable properly (with
+ * recoloring), you have to set its icon name on a #GtkImage.
+ *
  * Returns: %TRUE if the icon is symbolic, %FALSE otherwise
  */
 gboolean